package top.tagao.m02_creationalPatterns.c_02_singleton;

/**
 * 饿汉式 不加锁
 * @author fu-xiao-liu
 * @Date 2022/6/20 23:18
 * 存在并发问题
 */
public class Singleton1 {
    private Singleton1() {
    }

    private  static Singleton1 s1;

    public static Singleton1 getInstance(){
        if(s1 == null){
            s1 = new Singleton1();
        }
       return  s1;
    }
}
